package com.jy.wms.common.quartz;

import com.jy.wms.service.WmsProductVelocityService;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;

/**
 * 产品周转率定时器job
 * Created by syh on 2018/5/8.
 */
public class WmsProductVelocityScheduledJob  implements Job {
    private WmsProductVelocityService wmsProductVelocityService;
    private static Logger log = LoggerFactory.getLogger(WmsProductVelocityScheduledJob.class);
    private SimpleDateFormat dateFormat() {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    }
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            JobDataMap dataMap = context.getJobDetail().getJobDataMap();
            wmsProductVelocityService = (WmsProductVelocityService)dataMap.get("wmsProductVelocityService");
            wmsProductVelocityService.getVelocityTimer();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}